class Solution(object):
    def checkIfCanBreak(self, s1, s2):
        s1 = list(s1)
        s1.sort()
        s2 = list(s2)
        s2.sort()
        s1, s2 = min(s1, s2), max(s1, s2)
        n = len(s1)
        for i in range(n):
            if s1[i] > s2[i]:
                return False
        return True